const user = require("../../database/user")

module.exports = async (req,res,next)=>{
  const {uId} = req.body;

  if(req.power !== 0){
    res.send({
      code:4,
      msg:"权限不够"
    })
    return;
  }

  if(!uId){
    res.send({
      code:3,
      msg:"缺少必传参数：uId"
    })
    return;
  }

  await user.deleteOne({uId});
  
  res.send({
    code:1,
    msg:"删除成功"
  })
}